/**
 * 
 */
package com.kyxx.topics.utils;

import android.content.Context;
import android.widget.Toast;

public class ToastUtils {
	private static Toast mToast;

	public static void show(Context context, String text) {

		if (mToast != null)
			mToast.setText(text);
		else
			mToast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
		mToast.show();
	}

	public static void show(Context context, String text, int flag) {

		if (mToast != null)
			mToast.setText(text);
		else
			mToast = Toast.makeText(context, text,
					flag == 0 ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG);
		mToast.show();
	}

	public static void show(Context mContext, int resId) {
		show(mContext, mContext.getResources().getString(resId));
	}
}
